package adapter;

import java.util.List;

import model.LTModel;

import com.friehome.app.R;
import com.utils.Comm;
import com.utils.TTUtils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;



public class IndexAdapter extends BaseAdapter{

	Context context;
	List<LTModel> data;
	
	public IndexAdapter(Context context,List<LTModel> data) {
		this.context = context;
		this.data = data;
		
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(R.layout.item_index, null);
		}
		
		
		
		TextView text = (TextView) convertView.findViewById(R.id.text);
		text.setText(data.get(position).name);
		//image.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, (Comm.pHeight - TTUtils.dip2px(context, 48)) / 3));
		return convertView;
	}

}
